import CocosHelper from "../../TFrame/script/helper/CocosHelper";
import IconFramesMgr from "../IconFramesMgr";
import PlayerDataMgr from "../PlayerDataMgr";
import Util from "../../../StartAb/Util";

const {ccclass, property} = cc._decorator;

@ccclass
export default class HomeButton extends cc.Component {
    click(e: cc.Event.EventTouch) {
        if(PlayerDataMgr.isADVideo) {
            IconFramesMgr.getInstance().loadIcons(() => {
                Util.changeScene("levelList_ad");
                cc.log('icon load done');
            })
        }else {
            Util.changeScene("Home");
        }
        CocosHelper.disableButton(e);
    }
}
